$(function(){
    getListPage({"curPage":1});
    var parentFlag = $("#parentFlag").val();
    $(".titR").click(function(){
        if(parentFlag == 'mine'){
            navPills("systemMineOrderHtml",2);
        }else if(parentFlag == 'business'){
            navPills("systemBusinessHtml");
        } else{
            navPills("systemOrderCenterHtml",2);
        }

    });

});
function getListPage(param){
    var orderId = $("#orderId").val();
    if(orderId == ""){
        $(".titR").hide();
    }
    $.ajax({
        type : "post",
        url : "htmlWeb/getOrderDetailList",
        data: $.extend({"orderId" : orderId},param),
        async: false,
        success : function(data){
            $("#orderDetailPageHead ~ tr").remove();
            var str = "";
            $.each(data.rows,function(i,obj){
                // obj = trimEmpty(obj);
                var createTime = formatDate(obj.scheduleDate,"yyyy-MM-dd");
                str += '<tr><td><p>' + obj.id + '</p></td>' +
                    '<td><p>' + obj.user.cnName + '</p></td>' +
                    '<td><p>' + obj.bizUser.cnName + '</p></td>' +
                    '<td><p>' + obj.byUserBizProduct.name + '</p></td>' +
                    '<td><p>' + obj.amount + '</p></td>' +
                    '<td><p>' + obj.price + '</p></td>' +
                    '<td><p>' + createTime + '</p></td>' +
                    '<td><p>' + obj.dinnerType + '</p></td></tr>';
            });

            $("#orderDetailPageHead").after(str);
            createPage(data);
        },
        error : function(data){
            console.log(data);
        }
    });
}